#include "lidar.h"

Lidar::Lidar() {
    _lidarModel = "RS-Helios-16p";
    _lidarChannelCount = 16;
    _lidarRange = 100.0;
    _powerConsumption = 8.0;
}

void Lidar::print() {
    cout << "Lidar:" << endl;
    cout << "\tlidarModel: " << _lidarModel << endl;
    cout << "\tChannel Count: " << _lidarChannelCount << "c" << endl;
    cout << "\tRange: " << _lidarRange << "m" << endl;
    cout << "\tPower Consumption: " << _powerConsumption << "W" << endl;
}

int Lidar::save(YAML::Node& node) {
    node["Lidar"] = YAML::Node(YAML::NodeType::Map);
    node["Lidar"]["lidarModel"] = _lidarModel;
    node["Lidar"]["lidarChannelCount"] = _lidarChannelCount;
    node["Lidar"]["lidarRange"] = _lidarRange;
    node["Lidar"]["powerConsumption"] = _powerConsumption;
    return 0;
}

int Lidar::setLidarModel(std::string model) {
    _lidarModel = model;
    return 0;
}

void Lidar::setLidarChannelCount(int channelCount) {
    _lidarChannelCount = channelCount;
}

void Lidar::setLidarRange(float range) {
    _lidarRange = range;
}

void Lidar::setPowerConsumption(float consumption) {
    _powerConsumption = consumption;
}
